<!--
  @author tanlei
  @since 2021/07/06 14:52
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<div class="layui-card-body " th:fragment="new_order_company_rob_order">
    <form method="POST" action="" class="layui-form" lay-filter="zmn-company-rob-order-form" id="zmn-company-rob-order-form">
<!--        <hr th:if="${obj.distributeWay == 10}" class="layui-bg-gray">-->
        <div class="layui-row">
            <div class="layui-col-sm10">
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">服务平台</label>
                    <div class="layui-input-inline">
                        <select name="plat" id="plat" lay-filter="plat" class="layui-disabled" disabled>
                            <option value="" th:selected="${0 == obj.plat}">全部</option>
                            <option th:value="${item.key}"
                                    th:text="${item.value}"
                                    th:selected="${item.key == obj.plat}"
                                    th:each="item:${platList}">平台
                            </option>
                        </select>
                    </div>
                </div>
            </div>
        </div>

        <div class="layui-row">
            <div class="layui-col-sm10">
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">服务商</label>
                    <div class="layui-input-inline" style="width: 200px">
                        <th:block th:if="${obj.weightId != null}">
                            <input type="hidden" name="robCompanyId" th:value="${obj.companyId}">
                            <label style="margin-left: 2px;line-height: 34px;" th:text="${obj.companyName}"></label>
                        </th:block>
                        <th:block th:unless="${obj.weightId}">
                            <div id="robCompanyId" style="width: 190px"></div>
                        </th:block >

<!--                        <select id="robCompanyId" lay-filter="robCompanyId" name="robCompanyId" th:disabled="${obj.weightId}"-->
<!--                                lay-verify="required" lay-search>-->
<!--                            <option value="" th:selected="${0 == obj.companyId}">全部</option>-->
<!--                            <option th:value="${item.value}"-->
<!--                                    th:text="${item.text}"-->
<!--                                    th:selected="${item.value == obj.companyId}"-->
<!--                                    th:each="item:${companyList}">平台-->
<!--                            </option>-->
<!--                        </select>-->
                    </div>
                </div>
            </div>
        </div>

        <div class="layui-row">
            <div class="layui-col-sm10">
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">城市</label>
                    <div class="layui-input-inline">
                        <th:block th:if="${obj.weightId != null}">
                            <input type="hidden" name="robCityId" th:value="${obj.cityId}">
                            <label style="margin-left: 2px;line-height: 34px;" th:text="${obj.cityName}"></label>
                        </th:block>
                        <th:block th:unless="${obj.weightId != null}">
                            <select name="robCityId" id="robCityId" lay-filter="robCityId"
                                    lay-verify="required"
                                    th:disabled="${obj.weightId}" lay-search>
                                <option value="">全部</option>
                                <option th:value="${item.value}"
                                        th:text="${item.text}"
                                        th:selected="${item.value == obj.cityId}"
                                        th:each="item:${cityList}">城市
                            </select>
                        </th:block >


                    </div>
                    <div class="layui-form-mid layui-word-aux">请先选择：服务商，再选：城市</div>
                </div>
            </div>
        </div>

        <div class="layui-card">

            <div class="layui-card-header">抢单状态：</div>
            <div class="layui-row">
                <div class="layui-col-sm10 layui-form">
                    <div class="layui-form-item">
                        <div class="layui-input-inline">
                            <input type="checkbox" id="robOrderStatus" name="robOrderStatus" lay-verify="required"
                                   th:checked="${robOrderObj.robOrderStatus == 2}"
                                   lay-filter="robOrderStatus"
                                   lay-text="ON|OFF" value="2" lay-skin="switch"/>
                        </div>
                        <div class="layui-form-mid layui-word-aux">针对：新单&普通派单，打开状态，即：只会判断基础条件</div>
                    </div>
                </div>
            </div>
            <div class="layui-card-header">抢单条件：<span style="color: #ff2222">（以下设置条件都满足才抢单）</span></div>

            <div class="layui-card-header">工单设置：</div>

            <div class="layui-row" style="display: none">
                <div class="layui-col-sm10 layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label layui-form-required">relationId:</label>
                        <div class="layui-input-inline">
                            <input  type="text" name="relationId" id="relationId"
                                    class="layui-input"/>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-row">
                <div class="layui-col-sm10 layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">下单时间段:</label>
                        <div class="layui-input-inline">
                            <input  type="text" name="orderTimeStr" id="orderTimeStr"
                                   class="layui-input"/>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-row">
                <div class="layui-col-sm10 layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label ">预约时间段:</label>
                        <div class="layui-input-inline">
                            <input  type="text" name="appointmentTimeStr" id="appointmentTimeStr"
                                   class="layui-input"/>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-row">
                <div class="layui-col-sm10 layui-form">
                    <div class="layui-form-item" >
                        <label class="layui-form-label ">剔除渠道：</label>
                        <div class="layui-input-inline" >
                            <div id="channelOneIdList"></div>
                        </div>
                        <div class="layui-input-inline" >
                            <div id="channelTwoIdList"></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-row">
                <div class="layui-col-sm10 layui-form">
                    <div class="layui-form-item" >
                        <label class="layui-form-label">剔除品类：</label>
                        <div class="layui-input-inline" >
                            <div id="ecServCategId"></div>
                        </div>
                        <div class="layui-input-inline" >
                            <div id="ecServCategOneIdList"></div>
                        </div>
                    </div>
                </div>
            </div>
            <div id="productFlag" class="productFlag"></div>
            <div class="layui-input-block">
                <a href="javascript:void(0)" id="addProducts" class="addProducts"
                   style="text-decoration:underline;color: #00a0e9">+添加</a>
            </div>
            <div class="layui-card-header">工程师设置：</div>
            <div class="layui-row">
                <div class="layui-col-sm10 layui-form">
                    <div class="layui-form-item" style="margin-top: 10px">
                        <label class="layui-form-label layui-form-required">工程师类型:</label>
                        <div class="layui-input-inline">
                            <select name="engineerType" lay-verify="required"
                                    lay-search=""
                                    lay-filter="engineerType" id="engineerType" autocomplete="off">
                                <option value="">请选择工程师</option>
                                <option th:value="${item.key}"
                                        th:text="${item.value}"
                                        th:each="item:${engineerList}">
                            </select>
                        </div>
                        <div class="layui-form-mid layui-word-aux">当仅有此类型工程师时，工单将按抢单方式分配</div>
                    </div>
                </div>
            </div>
            <div class="layui-card-header">抢单时间:</div>
            <div class="layui-row">
                <div class="layui-col-sm10 layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label layui-form-required">抢单时间:</label>
                        <div class="layui-input-inline">
                            <input lay-verify="required" type="text" name="robOrderTimeStr" id="robOrderTimeStr"
                                   class="layui-input"/>
                        </div>
                    </div>
                </div>
            </div>
            <div id="dynamic" class="dynamic"></div>
            <div class="layui-input-block">
                <a href="javascript:void(0)" id="addRules" class="addRules"
                   style="text-decoration:underline;color: #00a0e9">+添加规则</a>
            </div>

            <div class="layui-row">
                <div class="layui-col-sm10">
                    <div class="layui-form-item submit">
                        <div class="layui-input-block">
                            <button class="layui-btn " lay-submit="" lay-filter="zmn-rob-order-form-submit">提交
                            </button>
                            <button type="button" id="cancel" class="layui-btn layui-btn-primary">取消</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
</form>
</div>
